import Vue from 'vue'
const store = new Vue({
  data(){
    return {
      showHeaderSetting: false,
      showColumnSetting: false,
      headerStyle: {},
      columnStyle: {},
      columnEdit: {}
    }
  },
  methods: {
  }
})

export function mapGetters(names){
  let result = {}
  names.forEach(name => {
    result[name] = function(){
      return store[name]
    }
  })
  return result
}
export function commit(callback){
  callback(store)
}
export function emit(eventName, ...args){
  store.$emit(eventName, ...args)
}
export function on(eventName, callback){
  store.$on(eventName, callback)
}
export function off(eventName){
  store.$off(eventName)
}
export default store
